Fixes from David Hampton <hampton@employees.org> via gtk-devel-list.
authorKristian Rietveld <kris@gtk.org>
Mon, 8 Sep 2003 19:51:16 +0000 (19:51 +0000)
committerKristian Rietveld <kristian@src.gnome.org>
Mon, 8 Sep 2003 19:51:16 +0000 (19:51 +0000)
Mon Sep  8 21:44:20 2003  Kristian Rietveld  <kris@gtk.org>

Fixes from David Hampton <hampton@employees.org> via gtk-devel-list.

* gtk/gtktreemodelfilter.c (gtk_tree_model_filter_elt_get_path): fix
the call to gtk_tree_model_filter_add_root,
(gtk_tree_model_filter_row_changed): bail out if c_path is not above
the virtual root, allow building levels on the second try to convert
the child path to a filter path,
(gtk_tree_model_filter_convert_iter_to_child_iter): pass the virtual
root when calling gtk_tree_model_filter_elt_get_path.

ChangeLog
ChangeLog.pre-2-10
ChangeLog.pre-2-4
ChangeLog.pre-2-6
ChangeLog.pre-2-8
gtk/gtktreemodelfilter.c

index 318b16d878c6767c850c6a1b237e355551b05068..8be5ebc5f45ce1e44d58293055f6577238a86618 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+Mon Sep  8 21:44:20 2003  Kristian Rietveld  <kris@gtk.org>
+
+       Fixes from David Hampton <hampton@employees.org> via gtk-devel-list.
+
+       * gtk/gtktreemodelfilter.c (gtk_tree_model_filter_elt_get_path): fix
+       the call to gtk_tree_model_filter_add_root,
+       (gtk_tree_model_filter_row_changed): bail out if c_path is not above
+       the virtual root, allow building levels on the second try to convert
+       the child path to a filter path,
+       (gtk_tree_model_filter_convert_iter_to_child_iter): pass the virtual
+       root when calling gtk_tree_model_filter_elt_get_path.
+
 2003-09-07  Matthias Clasen  <maclas@gmx.de>
 
        * gtk/gtkuimanager.c (update_node): Fix a C99ism.  (#121640,
index 318b16d878c6767c850c6a1b237e355551b05068..8be5ebc5f45ce1e44d58293055f6577238a86618 100644 (file)
@@ -1,3 +1,15 @@
+Mon Sep  8 21:44:20 2003  Kristian Rietveld  <kris@gtk.org>
+
+       Fixes from David Hampton <hampton@employees.org> via gtk-devel-list.
+
+       * gtk/gtktreemodelfilter.c (gtk_tree_model_filter_elt_get_path): fix
+       the call to gtk_tree_model_filter_add_root,
+       (gtk_tree_model_filter_row_changed): bail out if c_path is not above
+       the virtual root, allow building levels on the second try to convert
+       the child path to a filter path,
+       (gtk_tree_model_filter_convert_iter_to_child_iter): pass the virtual
+       root when calling gtk_tree_model_filter_elt_get_path.
+
 2003-09-07  Matthias Clasen  <maclas@gmx.de>
 
        * gtk/gtkuimanager.c (update_node): Fix a C99ism.  (#121640,
index 318b16d878c6767c850c6a1b237e355551b05068..8be5ebc5f45ce1e44d58293055f6577238a86618 100644 (file)
@@ -1,3 +1,15 @@
+Mon Sep  8 21:44:20 2003  Kristian Rietveld  <kris@gtk.org>
+
+       Fixes from David Hampton <hampton@employees.org> via gtk-devel-list.
+
+       * gtk/gtktreemodelfilter.c (gtk_tree_model_filter_elt_get_path): fix
+       the call to gtk_tree_model_filter_add_root,
+       (gtk_tree_model_filter_row_changed): bail out if c_path is not above
+       the virtual root, allow building levels on the second try to convert
+       the child path to a filter path,
+       (gtk_tree_model_filter_convert_iter_to_child_iter): pass the virtual
+       root when calling gtk_tree_model_filter_elt_get_path.
+
 2003-09-07  Matthias Clasen  <maclas@gmx.de>
 
        * gtk/gtkuimanager.c (update_node): Fix a C99ism.  (#121640,
index 318b16d878c6767c850c6a1b237e355551b05068..8be5ebc5f45ce1e44d58293055f6577238a86618 100644 (file)
@@ -1,3 +1,15 @@
+Mon Sep  8 21:44:20 2003  Kristian Rietveld  <kris@gtk.org>
+
+       Fixes from David Hampton <hampton@employees.org> via gtk-devel-list.
+
+       * gtk/gtktreemodelfilter.c (gtk_tree_model_filter_elt_get_path): fix
+       the call to gtk_tree_model_filter_add_root,
+       (gtk_tree_model_filter_row_changed): bail out if c_path is not above
+       the virtual root, allow building levels on the second try to convert
+       the child path to a filter path,
+       (gtk_tree_model_filter_convert_iter_to_child_iter): pass the virtual
+       root when calling gtk_tree_model_filter_elt_get_path.
+
 2003-09-07  Matthias Clasen  <maclas@gmx.de>
 
        * gtk/gtkuimanager.c (update_node): Fix a C99ism.  (#121640,
index 318b16d878c6767c850c6a1b237e355551b05068..8be5ebc5f45ce1e44d58293055f6577238a86618 100644 (file)
@@ -1,3 +1,15 @@
+Mon Sep  8 21:44:20 2003  Kristian Rietveld  <kris@gtk.org>
+
+       Fixes from David Hampton <hampton@employees.org> via gtk-devel-list.
+
+       * gtk/gtktreemodelfilter.c (gtk_tree_model_filter_elt_get_path): fix
+       the call to gtk_tree_model_filter_add_root,
+       (gtk_tree_model_filter_row_changed): bail out if c_path is not above
+       the virtual root, allow building levels on the second try to convert
+       the child path to a filter path,
+       (gtk_tree_model_filter_convert_iter_to_child_iter): pass the virtual
+       root when calling gtk_tree_model_filter_elt_get_path.
+
 2003-09-07  Matthias Clasen  <maclas@gmx.de>
 
        * gtk/gtkuimanager.c (update_node): Fix a C99ism.  (#121640,
index 3e5d52ce866b79a2c20b4a6f545241f52bd4f089..e5be15d23dedee0851ba0e46653b6d70c9111295 100644 (file)
@@ -584,9 +584,7 @@ gtk_tree_model_filter_elt_get_path (FilterLevel *level,
 
   if (root)
     {
-      real_path = gtk_tree_path_copy (root);
-
-      gtk_tree_model_filter_add_root (real_path, path);
+      real_path = gtk_tree_model_filter_add_root (path, root);
       gtk_tree_path_free (path);
       return real_path;
     }
@@ -1019,6 +1017,12 @@ gtk_tree_model_filter_row_changed (GtkTreeModel *c_model,
   else
     gtk_tree_model_get_iter (c_model, &real_c_iter, c_path);
 
+  /* is this node above the virtual root? */
+  if (filter->priv->virtual_root
+      && (gtk_tree_path_get_depth (filter->priv->virtual_root)
+          >= gtk_tree_path_get_depth (c_path)))
+    goto done;
+
   /* what's the requested state? */
   requested_state = gtk_tree_model_filter_visible (filter, &real_c_iter);
 
@@ -1096,7 +1100,7 @@ gtk_tree_model_filter_row_changed (GtkTreeModel *c_model,
   if (!path)
     path = gtk_real_tree_model_filter_convert_child_path_to_path (filter,
                                                                   c_path,
-                                                                  FALSE,
+                                                                  TRUE,
                                                                   TRUE);
 
   g_return_if_fail (path != NULL);
@@ -2505,7 +2509,7 @@ gtk_tree_model_filter_convert_iter_to_child_iter (GtkTreeModelFilter *filter,
 
       path = gtk_tree_model_filter_elt_get_path (filter_iter->user_data,
                                                  filter_iter->user_data2,
-                                                 NULL);
+                                                 filter->priv->virtual_root);
       gtk_tree_model_get_iter (filter->priv->child_model, child_iter, path);
       gtk_tree_path_free (path);
     }